]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Make sure to destroy non-existing workspaces
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 29 Sep 2020 16:38:40 +0000 (13:38 -0300)
committerMarge Bot <marge-bot@gnome.org>
Thu, 7 Jan 2021 14:04:03 +0000 (14:04 +0000)
Even if they're in the end of the list. So far we've managed to not be affected
by this bug because until GNOME 3.38, workspaces didn't have a background, and
there was no way to navigate to these leftover workspaces, but with the proposed
overview changes for GNOME 40 it'll be very much visible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1560>

js/ui/workspacesView.js

index 1e8faf34902a552ce8604750e8db38106c7ff01d..a7b3b878a92236e7aa3f587df5c2143a246233a1 100644 (file)
@@ -222,6 +222,11 @@ class WorkspacesView extends WorkspacesViewBase {
             }
         }
 
+        for (let j = this._workspaces.length - 1; j >= newNumWorkspaces; j--) {
+            this._workspaces[j].destroy();
+            this._workspaces.splice(j, 1);
+        }
+
         this._updateScrollPosition();
     }